Skip to content

ci: local npm run gate == CI gate + stale-green guard#101

Merged
mastermanas805 merged 1 commit into
mainfrom
ci/local-ci-gate-2026-05-19
May 21, 2026
Merged

ci: local npm run gate == CI gate + stale-green guard#101
mastermanas805 merged 1 commit into
mainfrom
ci/local-ci-gate-2026-05-19

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

What

Hardens the instanode-web CI gate so the failure modes hit this session cannot recur.

1. npm run gate — local gate == CI gate

New gate script in package.json:

tsc --noEmit && npm run build && vitest run

npm run build already chains tsc && vite build && node scripts/prerender.mjs — the exact sequence CI's build-and-test job runs. Fix agents previously ran vite build alone, which skips scripts/prerender.mjs; a crashing prerender step shipped a broken main even though the local build passed. npm run gate is one command that cannot pass while CI fails.

2. Stale-green guard

New up-to-date-with-base job in ci.yml. A PR can show a green run executed before a breaking commit landed on main — merging it would ship a broken base. This job runs git merge-base --is-ancestor origin/<base> HEAD and fails the PR if the branch is behind, forcing an "Update branch" before merge.

Verification

npm run gate runs clean locally: tsc + full build (incl. prerender) + 662 vitest tests pass.

Scope

Touches only package.json and .github/workflows/ci.yml — disjoint from any source changes.

🤖 Generated with Claude Code

The local gate must run EXACTLY what CI runs. Fix agents previously ran
`vite build` alone, which skips `scripts/prerender.mjs` — a crashing
prerender step shipped a broken main even though the local build passed.

- package.json: new `gate` script = `tsc --noEmit && npm run build &&
  vitest run`. `npm run build` already chains `tsc && vite build &&
  node scripts/prerender.mjs` — the exact CI build-and-test sequence.
  One command an agent/dev runs locally that cannot pass while CI fails.
- ci.yml: new `up-to-date-with-base` job fails the PR if its branch does
  not contain `origin/<base>` as an ancestor (git merge-base
  --is-ancestor). A stale-but-green PR now goes red, forcing an
  update-branch before merge instead of shipping a broken base.

Verified: `npm run gate` runs clean locally (tsc + build + 662 tests).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 force-pushed the ci/local-ci-gate-2026-05-19 branch from 7277018 to 764cbdb Compare May 20, 2026 16:59
@mastermanas805
Copy link
Copy Markdown
Member Author

Rebase attempt 2026-05-20 hit conflicts. main already has .github/workflows/ci.yml. Same review-vs-supersede call as #102.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

@mastermanas805
Copy link
Copy Markdown
Member Author

Status check 2026-05-20 — still adds value

Audit against current main (61a89cd):

  • package.json — main has no gate script. This PR adds gate: tsc --noEmit && npm run build && vitest run. Required by CLAUDE.md rule 23.
  • .github/workflows/ci.yml — main has no up-to-date-with-base job. This PR adds it.

Not replaced by INTEGRATION-TESTS-2026-05-20.md — that work targets api/worker/provisioner Go integration tests (backup/restore, Brevo webhook, propagation runner, deep /readyz). It does not touch instanode-web.

Verified live: ran npm run gate on this branch in a fresh worktree against current main — 38 test files / 662 tests pass; tsc clean; full build (incl. scripts/prerender.mjs) OK.

Mergeability: MERGEABLE / CLEAN. CI green (up-to-date-with-base, build-and-test, playwright all SUCCESS as of 2026-05-20 17:01 UTC).

Recommendation: merge. PR holds up against current main; the value (local gate == CI gate + stale-green guard) is not duplicated by any other 2026-05-20 work.

@mastermanas805 mastermanas805 merged commit 11b1ade into main May 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant